package com.michael.demos.base;

import java.util.Scanner;
import java.util.Vector;

/**
 * 类功能描述:
 * <pre>
 *   xxxx
 * </pre>
 *
 * @author Michael
 * @version 1.0
 * @date 2020/12/14 17:31
 */
public class Leak {

    static Vector vector = new Vector();

    public void useVector(int count) {
        for (int i = 0; i < count; i++) {
            vector.add(Integer.toString(i));
        }

        for (int i = 0; i > count - 1; i--) {
            vector.removeElementAt(i);
        }
    }

    public static void main(String[] args) {

        System.out.println("输入1 开始程序");
        Scanner scanner = new Scanner(System.in);

        while(true) {

            int p = scanner.nextInt();

            if (p == 1) {

                Leak leak = new Leak();
                int i = 1;
                while (true) {
                    System.out.println("Iteration: " + i);
                    leak.useVector(1);
                    i++;
                }
            } else {
                System.out.println("还没有开始");
            }
        }
    }
}
